﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace Tfs_analyzer.BaseValidators
{
  class AttachedFilesValidator : IChangesetValidator
  {
    IValidationResult IChangesetValidator.CheckChangeset(Changeset i_changeset_to_analyze, IEnumerable i_changesets)
    {
      ValidationResult res = new ValidationResult();

      if (i_changeset_to_analyze.AssociatedWorkItems == null)
      {
        return res;
      }
      else if (i_changeset_to_analyze.Changes.Length <= 10)
      {
        res.SetMark(3);
        res.SetReason("Associated WI count lq than 10");
      }
      else if (i_changeset_to_analyze.Changes.Length <= 20 )
      {
        res.SetMark(2);
        res.SetReason("Associated WI count lq than 20");
      }
      else
      {
        res.SetMark(-5);
        res.SetReason("No associated WIs");
      }
      return res;
    }


  }
}
